package com.example.rocketmq.consumer;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
@Slf4j
@RocketMQMessageListener(topic = "producer-yc",consumerGroup = "producer-yc",
        messageModel = MessageModel.CLUSTERING)
public class ConsumerYanchi implements RocketMQListener<String> {
    @Override
    public void onMessage(String message) {
        System.out.println(message+" "+"时间2:"+new Date());
    }
}